********************************************************************************
* 							HISTORICAL ANALOGIES 							   *
********************************************************************************

clear all

ssc install reghdfe, replace
ssc install ftools, replace
ssc install carryforward, replace
ssc install grstyle, replace
ssc install outreg2, replace
ssc install coefplot, replace
ssc install ppmlhdfe, replace
ssc install synth, replace
ssc install synth2, replace
ssc install estout, replace
ssc install copydesc, replace

set more off
set scheme s2color
grstyle init
grstyle set plain, horizontal grid dotted
macro drop _all
est drop _all
set matsize 800
set seed 8675309

** Set Working Directory

if c(username) == "cb2257"{
global dir "~/Desktop"  // CWB's Directory
global main "${dir}/Replication"			
global data "${main}/data"	
global code "${main}/code"	
global figs "${main}/figures"	
global tabs "${main}/tables"																		
}

if c(username) == "cb2257"{
global dir "~/Desktop"  // CWB's Directory
global main "${dir}/Replication"			
global data "${main}/data"	
global code "${main}/code"	
global figs "${main}/figures"	
global tabs "${main}/tables"																		
}

else if c(username) == "yourusername"{
global dir "~/yourfilepath"  // YOUR Directory
}

cd "${main}"

********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************

import delimited "data/Study1Data.csv", clear

**********Study 1**********

gen munich = 0
replace munich = 1 if  treatment=="Control (Munich)" | treatment=="Treatment (Munich)"

gen cuba = 0
replace cuba = 1 if  treatment=="Control (Cuban)" | treatment=="Treatment (Cuban)"

gen analogy_treatment = 0
replace analogy_treatment = 1 if treatment=="Treatment (Munich)" | treatment=="Treatment (Cuban)"

gen tactical_s = tactical_s_m
replace tactical_s = tactical_s_c if cuba==1

encode tactical_s, gen(tactical_suc)

gen success_pooled = (general_s + tactical_suc + strategic) / 3

encode m_c, gen(moral_cuba)
encode m_m, gen(moral_munich)
gen moral = .
replace moral = moral_cuba if cuba==1
replace moral = moral_munich if munich==1


*****Table A.1: Robustness

***Effect of Analogies on Policy Credibility with Covariates 
eststo: regress cred analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if munich==1, robust

eststo: regress cred analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if cuba==1, robust

eststo: regress cred analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white , robust

***Effect of Analogies on Perceived Chance of Policy Success with Covariates 
eststo: regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if munich==1, robust

eststo: regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if cuba==1, robust

eststo: regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust

***Effect of Analogies on Cost-Benefit Analysis with Covariates 
eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if munich==1, robust

eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if cuba==1, robust

eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white , robust

***Effect of Analogies on Perceptions of Leader Traits with Covariates 
eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if munich==1, robust

eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if cuba==1, robust

eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white , robust

***Effect of Analogies on Moral Obligation to Intervene with Covariates 
eststo: regress moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if munich==1, robust

eststo: regress moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white  if cuba==1, robust

eststo: regress moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white , robust

***Make Table 
esttab using "tables/tablea1.tex", replace noeqlines eqlabels(none) nogaps se varlabels(analogy_treatment "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" education "Education" male "Male" inc "Income" inc_rf "Did Not Disclose Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 1 Robustness Tests) b(3) se(3)
eststo clear


*****Table A.2: Mediation Models 

***Success 
eststo: regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust

eststo: regress cred success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust

medeff (regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white) (regress cred success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white), mediate(success_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Cost-Benefit 
eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust 

eststo: regress cred cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white

medeff (regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white) (regress cred cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white), mediate(cb_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Leader Traits
eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust

eststo: regress cred conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust

medeff (regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white) (regress cred conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white), mediate(conf_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Morality 
eststo: regress moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust 

eststo: regress cred moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white, robust

medeff (regress moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white) (regress cred moral analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white), mediate(moral) treat(analogy_treatment) sims(2000) seed(12345)

***Make Table 
esttab using "tables/tablea2.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_treatment "Historical Analogy" success_pooled "Policy Likely to be Successful" cb_pooled "Benefits Exceed Costs" conf_pooled "Positive Presidential Trait" moral "Moral Obligation to Intervene" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" education "Education" male "Male" inc "Income" inc_rf "Did Not Disclose Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 1 Mediation Analysis) b(3) se(3)
eststo clear



*****Table A.3: Heterogeneous Effects 

***Hawkishness
eststo: regress cred i.analogy_treatment##c.disposition_pooled republicanpresident pid fp_knowledge education male inc inc_rf age white , robust

***Political Identification
eststo: regress cred i.analogy_treatment##c.pid republicanpresident disposition_pooled fp_knowledge education male inc inc_rf age white , robust

***Co-Partisans 
gen co_partisans = .
replace co_partisans = 0 if (democrat==1 & republicanpresident==1) | (republican==1 & democraticpresident==1)
replace co_partisans = 1 if (democrat==1 & democraticpresident==1) | (republican==1 & republicanpresident==1)

eststo: regress cred i.analogy_treatment##i.co_partisans republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf age white , robust

***Foreign Policy Knowledge
eststo: regress cred i.analogy_treatment##c.fp_knowledge republicanpresident disposition_pooled pid education male inc inc_rf age white , robust

***Education
eststo: regress cred i.analogy_treatment##c.education republicanpresident disposition_pooled pid fp_knowledge male inc inc_rf age white , robust

***Gender
eststo: regress cred i.analogy_treatment##i.male republicanpresident disposition_pooled pid fp_knowledge education inc inc_rf age white , robust

***Age
eststo: regress cred i.analogy_treatment##c.age republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf white , robust

***Over 70
gen over_70 = 0
replace over_70 = 1 if age>=70

eststo: regress cred i.analogy_treatment##i.over_70 republicanpresident disposition_pooled pid fp_knowledge education male inc inc_rf white , robust

***Make Table 
esttab using "tables/tablea3.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_treatment "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" education "Education" male "Male" inc "Income" inc_rf "Did Not Disclose Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 1 Heterogeneous Effects) b(3) se(3)
eststo clear

********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************

import delimited "data/Study2Data.csv", clear

**********Study 2**********

gen BosniaControl = . 
replace BosniaControl = 0 if z1==1 | z1==2 | z1==3 | z1==4 | z1==5
replace BosniaControl = 1 if z1==0

gen BosniaPos = . 
replace BosniaPos = 0 if z1==0 | z1==2 | z1==3 | z1==4 | z1==5
replace BosniaPos = 1 if z1==1

gen BosniaNeg = . 
replace BosniaNeg = 0 if z1==0 | z1==1 | z1==3 | z1==4 | z1==5
replace BosniaNeg = 1 if z1==2

gen PosVsNeg = .
replace PosVsNeg = 0 if BosniaNeg==1
replace PosVsNeg = 1 if BosniaPos==1

gen IranControl = . 
replace IranControl = 0 if z1==1 | z1==2 | z1==0 | z1==4 | z1==5
replace IranControl = 1 if z1==3

gen IranHighFam = . 
replace IranHighFam = 0 if z1==1 | z1==2 | z1==0 | z1==3 | z1==5
replace IranHighFam = 1 if z1==4

gen IranLowFam = . 
replace IranLowFam = 0 if z1==1 | z1==2 | z1==0 | z1==3 | z1==4
replace IranLowFam = 1 if z1==5

gen HighvsLowFamiliar = .
replace HighvsLowFamiliar = 0 if IranLowFam==1
replace HighvsLowFamiliar = 1 if IranHighFam==1

gen analogy_treatment = 0
replace analogy_treatment = 1 if z1==1 | z1==2 | z1==4 | z1==5 

gen Myanmar = 0
replace Myanmar = 1 if z1==0 | z1==1 | z1==2

gen Iran = 0
replace Iran = 1 if z1==3 | z1==4 | z1==5

gen credibility = .
replace credibility = cred_val if Myanmar==1
replace credibility = cred_fam if Iran==1

gen success_pooled_myanmar = .
replace success_pooled_myanmar = (general_s + tactical_success_valence + strategic_success_valence) / 3 if z1==0 | z1==1 | z1==2

gen success_pooled_iran = .
replace success_pooled_iran = (general_s + tactical_familiar + strategic_success_familiar) / 3 if z1==3 | z1==4 | z1==5

gen success_pooled = .
replace success_pooled=success_pooled_myanmar if Myanmar==1
replace success_pooled=success_pooled_iran if Iran==1

gen moral_pooled = . 
replace moral_pooled=moral_valence if z1==0 | z1==1 | z1==2
replace moral_pooled=moral_familiar if z1==3 | z1==4 | z1==5


*****Table A.4: Robustness

***Effect of Analogies on Policy Credibility with Covariates 
eststo: regress cred_val analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

eststo: regress cred_fam analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

eststo: regress credibility analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Effect of Analogies on Perceived Chance of Policy Success with Covariates 
eststo: regress success_pooled_myanmar analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

eststo: regress success_pooled_iran analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

eststo: regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Effect of Analogies on Cost-Benefit Analysis with Covariates 
eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Effect of Analogies on Perceptions of Leader Traits with Covariates 
eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Effect of Analogies on Moral Obligation to Intervene with Covariates 
eststo: regress moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

eststo: regress moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

eststo: regress moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Make Table 
esttab using "tables/tablea4.tex", replace noeqlines eqlabels(none) nogaps se varlabels(analogy_treatment "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" negativity_bias_pooled "Negativity Bias" education "Education" male "Male" income "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 2 Robustness Tests) b(3) se(3)
eststo clear


*****Table A.5: Causal Mediation Analysis 

***Success 
eststo: regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress credibility success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

medeff (regress success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white) (regress credibility success_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white), mediate(success_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Cost-Benefit 
eststo: regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust 

eststo: regress credibility cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white

medeff (regress cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white) (regress credibility cb_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white), mediate(cb_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Leader Traits
eststo: regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress credibility conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

medeff (regress conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white) (regress credibility conf_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white), mediate(conf_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Morality 
eststo: regress moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust 

eststo: regress credibility moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

medeff (regress moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white) (regress credibility moral_pooled analogy_treatment republicanpresident disposition_pooled pid fp_knowledge education male income age white), mediate(moral_pooled) treat(analogy_treatment) sims(2000) seed(12345)

***Make Table 
esttab using "tables/tablea5.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_treatment "Historical Analogy" success_pooled "Policy Likely to be Successful" cb_pooled "Benefits Exceed Costs" conf_pooled "Positive Presidential Trait" moral "Moral Obligation to Intervene" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" negativity_bias_pooled "Negativity Bias" education "Education" male "Male" income "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 2 Mediation Analysis) b(3) se(3)
eststo clear


*****Table A.6: Heterogeneous Effects for Myanmar Scenario

***Negativity Bias 
eststo: regress cred_val i.analogy_treatment##c.negativity_bias_pooled republicanpresident disposition_pooled pid fp_knowledge education male income age white if Myanmar==1, robust

***Hawkishness
eststo: regress cred_val i.analogy_treatment##c.disposition_pooled republicanpresident pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

***Political Identification
eststo: regress cred_val i.analogy_treatment##c.pid republicanpresident disposition_pooled fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

***Co-Partisans 
gen co_partisans = .
replace co_partisans = 0 if (democrat==1 & republicanpresident==1) | (republican==1 & democraticpresident==1)
replace co_partisans = 1 if (democrat==1 & democraticpresident==1) | (republican==1 & republicanpresident==1)

eststo: regress cred_val i.analogy_treatment##co_partisans republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Myanmar==1, robust

***Foreign Policy Knowledge
eststo: regress cred_val i.analogy_treatment##c.fp_knowledge republicanpresident disposition_pooled pid negativity_bias_pooled education male income age white if Myanmar==1, robust

***Education
eststo: regress cred_val i.analogy_treatment##c.education republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled male income age white if Myanmar==1, robust

***Gender 
eststo: regress cred_val i.analogy_treatment##i.male republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education income age white if Myanmar==1, robust

***Age 
eststo: regress cred_val i.analogy_treatment##c.age republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income white if Myanmar==1, robust

***Over 40 / Over 67
gen over_40 = 0
replace over_40 = 1 if age>=40

eststo: regress cred_val i.analogy_treatment##i.over_40 republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income white if Myanmar==1, robust

***Make Table 
esttab using "tables/tablea6.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_treatment "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" negativity_bias_pooled "Negativity Bias" education "Education" male "Male" income "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 2 Heterogeneous Effects for Myanmar Scenario) b(3) se(3)
eststo clear


*****Table A.7: Heterogeneous Effects for Iran Scenario

***Negativity Bias 
eststo: regress cred_fam i.analogy_treatment##c.negativity_bias_pooled republicanpresident disposition_pooled pid fp_knowledge education male income age white if Iran==1, robust

***Hawkishness
eststo: regress cred_fam i.analogy_treatment##c.disposition_pooled republicanpresident pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

***Political Identification
eststo: regress cred_fam i.analogy_treatment##c.pid republicanpresident disposition_pooled fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

***Co-Partisans 
eststo: regress cred_fam i.analogy_treatment##co_partisans republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white if Iran==1, robust

***Foreign Policy Knowledge
eststo: regress cred_fam i.analogy_treatment##c.fp_knowledge republicanpresident disposition_pooled pid negativity_bias_pooled education male income age white if Iran==1, robust

***Education
eststo: regress cred_fam i.analogy_treatment##c.education republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled male income age white if Iran==1, robust

***Gender 
eststo: regress cred_fam i.analogy_treatment##i.male republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education income age white if Iran==1, robust

***Age 
eststo: regress cred_fam i.analogy_treatment##c.age republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income white if Iran==1, robust

***Over 40 / Over 67
gen over_70 = 0
replace over_70 = 1 if age>=70

eststo: regress cred_fam i.analogy_treatment##i.over_70 republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income white if Iran==1, robust

***Make Table 
esttab using "tables/tablea7.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_treatment "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" negativity_bias_pooled "Negativity Bias" education "Education" male "Male" income "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 2 Heterogeneous Effects for Iran Scenario) b(3) se(3)
eststo clear


*****Table A.8: Positive vs. Negative and More vs. Less Familiar Analogies 

***Credibility 
eststo: regress credibility PosVsNeg republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress credibility HighvsLowFamiliar republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Success 
eststo: regress success_pooled PosVsNeg republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress success_pooled HighvsLowFamiliar republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Cost-Benefit
eststo: regress cb_pooled PosVsNeg republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress cb_pooled HighvsLowFamiliar republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Positive Presidential Traits 
eststo: regress conf_pooled PosVsNeg republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress conf_pooled HighvsLowFamiliar republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Moral Obligation to Intervene 
eststo: regress moral_pooled PosVsNeg republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

eststo: regress moral_pooled HighvsLowFamiliar republicanpresident disposition_pooled pid fp_knowledge negativity_bias_pooled education male income age white, robust

***Make Table 
esttab using "tables/tablea8.tex", replace noeqlines eqlabels(none) nogaps se varlabels(PosVsNeg "Positive vs. Negative Analogies" HighvsLowFamiliar "More vs. Less Familiar Analogies" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" negativity_bias_pooled "Negativity Bias" education "Education" male "Male" income "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 2 Positive vs. Negative and More vs. Less Familiar Analogie) b(3) se(3)
eststo clear

********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************

import delimited "data/Study3Data.csv", clear

**********Study 3**********

gen control = .
replace control = 0 if treatment=="Treatment Expert" | treatment=="Treatment Intuition" | treatment=="Treatment Munich"  
replace control = 1 if treatment=="Control Taiwan"

gen expert_treatment = .
replace expert_treatment = 0 if treatment=="Control Taiwan" | treatment=="Treatment Intuition" | treatment=="Treatment Munich"  
replace expert_treatment = 1 if treatment=="Treatment Expert"

gen gut_treatment = .
replace gut_treatment = 0 if treatment=="Control Taiwan" | treatment=="Treatment Expert" | treatment=="Treatment Munich"  
replace gut_treatment = 1 if treatment=="Treatment Intuition"

gen analogy_treatment = .
replace analogy_treatment = 0 if treatment=="Control Taiwan" | treatment=="Treatment Expert" | treatment=="Treatment Intuition"  
replace analogy_treatment = 1 if treatment=="Treatment Munich"

gen analogy_vs_control = .
replace analogy_vs_control = 0 if control==1
replace analogy_vs_control = 1 if analogy_treatment==1

gen analogy_vs_gut = .
replace analogy_vs_gut = 0 if gut_treatment==1
replace analogy_vs_gut = 1 if analogy_treatment==1

gen analogy_vs_expert = .
replace analogy_vs_expert = 0 if expert_treatment==1
replace analogy_vs_expert = 1 if analogy_treatment==1

gen success_pooled = (general_s + tactical_s_m + strategic) / 3



*****Table A.9: Robustness

***Effect of Analogies on Policy Credibility with Covariates 
eststo: regress cred analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Effect of Analogies on Perceived Chance of Policy Success with Covariates 
eststo: regress success_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Effect of Analogies on Cost-Benefit Analysis with Covariates 
eststo: regress cb_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Effect of Analogies on Perceptions of Leader Traits with Covariates 
eststo: regress conf_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Effect of Analogies on Moral Obligation to Intervene with Covariates 
eststo: regress m_m analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Make Table 
esttab using "tables/tablea9.tex", replace noeqlines eqlabels(none) nogaps se varlabels(analogy_vs_control "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" college "Education" male "Male" inc "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 3 Robustness Tests) b(3) se(3)
eststo clear


*****Table A.10: Mediation Models 

***Success 
eststo: regress success_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress cred success_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

medeff (regress success_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white) (regress cred success_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white), mediate(success_pooled) treat(analogy_vs_control) sims(2000) seed(12345)

***Cost-Benefit 
eststo: regress cb_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust 

eststo: regress cred cb_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white

medeff (regress cb_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white) (regress cred cb_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white), mediate(cb_pooled) treat(analogy_vs_control) sims(2000) seed(12345)

***Leader Traits
eststo: regress conf_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress cred conf_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

medeff (regress conf_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white) (regress cred conf_pooled analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white), mediate(conf_pooled) treat(analogy_vs_control) sims(2000) seed(12345)

***Morality
eststo: regress m_m analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust 

eststo: regress cred m_m analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

medeff (regress m_m analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white) (regress cred m_m analogy_vs_control republicanpresident disposition_pooled pid fp_knowledge college male inc age white), mediate(m_m) treat(analogy_vs_control) sims(2000) seed(12345)

***Make Table 
esttab using "tables/tablea10.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_vs_control "Historical Analogy" success_pooled "Policy Likely to be Successful" cb_pooled "Benefits Exceed Costs" conf_pooled "Positive Presidential Trait" m_m "m_m Obligation to Intervene" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" college "college" male "Male" inc "Income" "Did Not Disclose Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 3 Mediation Analysis) b(3) se(3)
eststo clear


*****Table A.11: Heterogeneous Effects 

***Hawkishness
eststo: regress cred i.analogy_vs_control##c.disposition_pooled republicanpresident pid fp_knowledge college male inc age white, robust

***Political Identification
eststo: regress cred i.analogy_vs_control##c.pid republicanpresident disposition_pooled fp_knowledge college male inc age white, robust

***Co-Partisans 
gen co_partisans = .
replace co_partisans = 0 if (democrat==1 & republicanpresident==1) | (republican==1 & democraticpresident==1)
replace co_partisans = 1 if (democrat==1 & democraticpresident==1) | (republican==1 & republicanpresident==1)

eststo: regress cred i.analogy_vs_control##co_partisans republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Foreign Policy Knowledge
eststo: regress cred i.analogy_vs_control##c.fp_knowledge republicanpresident disposition_pooled pid college male inc age white, robust

***college
eststo: regress cred i.analogy_vs_control##i.college republicanpresident disposition_pooled pid fp_knowledge male inc age white, robust

***Gender 
eststo: regress cred i.analogy_vs_control##i.male republicanpresident disposition_pooled pid fp_knowledge college inc age white, robust

***Age 
eststo: regress cred i.analogy_vs_control##c.age republicanpresident disposition_pooled pid fp_knowledge college male inc white, robust

***Over 70
gen over_70 = 0
replace over_70 = 1 if age>=70

eststo: regress cred i.analogy_vs_control##i.over_70 republicanpresident disposition_pooled pid fp_knowledge college male inc white, robust

***Make Table 
esttab using "tables/tablea11.tex", replace noeqlines eqlabels(none) nogaps se mtitles varlabels(analogy_vs_control "Historical Analogy" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" negativity_bias_pooled "Negativity Bias" college "Education" male "Male" income "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 3 Heterogeneous Effects) b(3) se(3)
eststo clear


*****Table A.12: Analogies vs. Gut and Analogies vs. Expert

***Policy Credibility with Covariates 
eststo: regress cred analogy_vs_gut republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress cred analogy_vs_expert republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Perceived Chance of Policy Success with Covariates 
eststo: regress success_pooled analogy_vs_gut republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress success_pooled analogy_vs_expert republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Cost-Benefit Analysis with Covariates 
eststo: regress cb_pooled analogy_vs_gut republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress cb_pooled analogy_vs_expert republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Perceptions of Leader Traits with Covariates 
eststo: regress conf_pooled analogy_vs_gut republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress conf_pooled analogy_vs_expert republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Moral Obligation to Intervene with Covariates 
eststo: regress m_m analogy_vs_gut republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

eststo: regress m_m analogy_vs_expert republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

***Make Table 
esttab using "tables/tablea12.tex", replace noeqlines eqlabels(none) nogaps se varlabels(analogy_vs_gut "Historical Analogy vs. Gut/Instinct Explanation" analogy_vs_expert "Historical Analogy vs. Appeal to Experts" republicanpresident "Republican President" disposition_pooled "Hawkishness" pid "Stronger Republican" fp_knowledge "Foreign Policy Knowledge" college "Education" male "Male" inc "Income" age "Age" white "White" _cons "Constant") label star(* 0.10 ** 0.05 *** .01) nonotes addnotes(Notes: Standard errors in parentheses. *p<0.10; **p< 0.05; ***p<0.01.) title(Study 3 Historical Analogies vs. Gut and Expert Justifications) b(3) se(3)
eststo clear

*****Figure A.13: Analogies vs. Gut and Analogies vs. Expert

regress cred analogy_treatment expert_treatment gut_treatment republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

coefplot, ci(95 90) ciopts(lcolor(black black) lwidth(.45 1.1)) vert keep(analogy_treatment expert_treatment gut_treatment) msymbol(O) mcolor(black) msize(vlarge) xlabel(1 `" "Historical" "Analogy" "' 2 `" "Appeal to" "Expertise" "' 3 `" "Gut" "Instinct" "') title("Perceptions the President Chose" "the Best Foreign Policy Strategy") ylabel(-.2(.2).6) ymtick(-.2(.1).6) yline(0, lcolor(cranberry) lpatt(shortdash)) ytitle("Effect of Treatment")
graph export "${figs}/treatment_credibility.png", replace

regress success_pooled analogy_treatment expert_treatment gut_treatment republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

coefplot, ci(95 90) ciopts(lcolor(black black) lwidth(.45 1.1)) vert keep(analogy_treatment expert_treatment gut_treatment) msymbol(O) mcolor(black) msize(vlarge) xlabel(1 `" "Historical" "Analogy" "' 2 `" "Appeal to" "Expertise" "' 3 `" "Gut" "Instinct" "') title("Perceived Likelihood of Policy Success") ylabel(-.2(.2).6) ymtick(-.2(.1).6) yline(0, lcolor(cranberry) lpatt(shortdash)) ytitle("Effect of Treatment")
graph export "${figs}/treatment_success.png", replace

regress cb_pooled analogy_treatment expert_treatment gut_treatment republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

coefplot, ci(95 90) ciopts(lcolor(black black) lwidth(.45 1.1)) vert keep(analogy_treatment expert_treatment gut_treatment) msymbol(O) mcolor(black) msize(vlarge) xlabel(1 `" "Historical" "Analogy" "' 2 `" "Appeal to" "Expertise" "' 3 `" "Gut" "Instinct" "') title("Perceptions that the Policy's" "Benefits Outweight its Costs") ylabel(-.2(.2).6) ymtick(-.2(.1).6) yline(0, lcolor(cranberry) lpatt(shortdash)) ytitle("Effect of Treatment")
graph export "${figs}/treatment_costs.png", replace

regress conf_pooled analogy_treatment expert_treatment gut_treatment republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

coefplot, ci(95 90) ciopts(lcolor(black black) lwidth(.45 1.1)) vert keep(analogy_treatment expert_treatment gut_treatment) msymbol(O) mcolor(black) msize(vlarge) xlabel(1 `" "Historical" "Analogy" "' 2 `" "Appeal to" "Expertise" "' 3 `" "Gut" "Instinct" "') title("Perceptions that the President has" "Positive Traits") ylabel(-.2(.2).6) ymtick(-.2(.1).6) yline(0, lcolor(cranberry) lpatt(shortdash)) ytitle("Effect of Treatment")
graph export "${figs}/treatment_traits.png", replace

regress m_m analogy_treatment expert_treatment gut_treatment republicanpresident disposition_pooled pid fp_knowledge college male inc age white, robust

coefplot, ci(95 90) ciopts(lcolor(black black) lwidth(.45 1.1)) vert keep(analogy_treatment expert_treatment gut_treatment) msymbol(O) mcolor(black) msize(vlarge) xlabel(1 `" "Historical" "Analogy" "' 2 `" "Appeal to" "Expertise" "' 3 `" "Gut" "Instinct" "') title("Perceptions that the U.S. has" "a Moral Obligation to Intervene") ylabel(-.2(.2).6) ymtick(-.2(.1).6) yline(0, lcolor(cranberry) lpatt(shortdash)) ytitle("Effect of Treatment")
graph export "${figs}/treatment_moral.png", replace


clear all
